import type { App } from "vue";
import {
  ElInput,
  ElInputNumber,
  ElSelect,
  ElOption,
  ElDatePicker,
  ElTreeSelect,
  ElTree,
  ElText,
} from "element-plus";
import { Dialog } from "./Dialog";
import { Icon } from "./Icon";
import iconSelect from "./IconSelect/index.vue";
import { SmTable } from "./SmTable";
import { SmForm } from "./SmForm";
import { CoordinateForm } from "./CoordinateForm";

export const setupGlobCom = (app: App<Element>): void => {
  const componentsMap: any = {
    Icon,
    iconSelect,
    ElInput,
    ElInputNumber,
    ElSelect,
    ElOption,
    ElDatePicker,
    ElTreeSelect,
    ElTree,
    Dialog,
    CoordinateForm,
    ElText,
    SmForm,
    SmTable,
  };
  for (const key in componentsMap) {
    app.component(key, componentsMap[key]);
  }
};
